package com.timeDeal.servlet;







import com.alibaba.druid.util.StringUtils;
import com.timeDeal.service.AdminService;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;





/**
 * Created by Administrator on 2016/7/24.
 */

public class ShenheTongguoServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, IOException, IOException {
            String leixing = request.getParameter("leixing");
            String id = request.getParameter("id");
            String  currentpage = request.getParameter("currentpage");
            AdminService adminservice = new AdminService();
            if(StringUtils.equals(leixing,"xuqiufabu")) {
                if (!adminservice.shenHeTongGuo(Integer.valueOf(id), "xuqiufabu")) {
                    response.getWriter().println("Url error!");
                    request.getRequestDispatcher("/admin/xuqiuchuligg.jsp?currentpage=" + currentpage).forward(request, response);
                }
            }
        else{
                if (!adminservice.shenHeTongGuo(Integer.valueOf(id), "shijianchushou")) {
                    response.getWriter().println("Url error!");
                    request.getRequestDispatcher("/admin/shijiangg.jsp?currentpage=" + currentpage).forward(request, response);
                }
            }
    }
}